home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
lisp
/
elk-2_0.lha
/
elk-2.0
/
examples
/
scheme
/
acker
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1991-09-25
|
221 b
|
15 lines
;;; -*-Scheme-*-
;;;
;;; The Ackermann function
(define (acker x y)
(cond
((zero? x)
(+ y 1))
((zero? y)
(acker (- x 1) 1))
(else
(acker (- x 1) (acker x (- y 1))))))
(print (acker 3 2))